package com.yiyuan.app.controller;

import com.guaike.core.entity.result.Result;
import com.yiyuan.app.entity.param.BoxDTO;
import com.yiyuan.app.entity.result.*;
import com.yiyuan.app.service.RechargeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping("/recharge")
@Api(tags = "充值商品相关接口组")
@AllArgsConstructor
public class RechargeController {

    private final RechargeService rechargeService;

    @GetMapping("/activityList")
    @ApiOperation(value = "充值活动列表")
    public Result<List<RechargeActivityVO>> activityList() {
        return rechargeService.activityList();
    }

    @GetMapping("/occupyList")
    @ApiOperation(value = "包机列表")
    public Result<List<ProductOccupyVO>> occupyList() {
        return rechargeService.occupyList();
    }

    @GetMapping("/productCardList")
    @ApiOperation(value = "周卡月卡列表")
    public Result<List<ProductCardVO>> productCardList() {
        return rechargeService.productCardList();
    }

    @GetMapping("/seriesRechargeList")
    @ApiOperation(value = "连续充值列表")
    public Result<RechargeSeriesVO> seriesRechargeList() {
        return rechargeService.seriesRechargeList();
    }

    @GetMapping("/forbidLookProduct")
    @ApiOperation(value = "禁止观看商品")
    public Result<LookOrLockVO> forbidLookProduct() {
        return rechargeService.forbidLookProduct();
    }

    @GetMapping("/lockProductList")
    @ApiOperation(value = "锁机商品列表")
    public Result<List<LookOrLockVO>> lockProductList() {
        return rechargeService.lockProductList();
    }

    @PostMapping("/getSeriesRechargeBox")
    @ApiOperation(value = "获取连续充值宝箱")
    public Result<Boolean> getSeriesRechargeBox(@RequestBody @Valid BoxDTO param) {
        return rechargeService.getSeriesRechargeBox(param);
    }
}
